package com.test.component;


import com.test.model.UserBean;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * @Author：徐志荣
 * @Date：2023/6/11 上午 9:33
 */

@Component
public class UserBeans {

    //设置上作用域
    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
    @Bean
    public UserBean display(){
        UserBean user = new UserBean();
        user.setId(1);
        user.setName("张三");
        user.setPassword("123456");
        return user;
    }

}
